import { S } from '../s';
import { IPSSysCss } from './ipssys-css';
import { IPSSysEditorStyle } from './ipssys-editor-style';
import { IPSSysPFPlugin } from './ipssys-pfplugin';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSSysEditorStyleImpl
  extends PSModelObjectImpl
  implements IPSSysEditorStyle
{
  get ajaxHandlerType(): 'None' | 'CodeList' | 'PickupText' | 'AC' | 'Custom' {
    return this.M.ajaxHandlerType;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get containerType(): 'FORMITEM' | 'GRIDCOLUMN' | 'PANELFIELD' {
    return this.M.containerType;
  }

  get editorHeight(): number {
    return this.M.editorHeight;
  }

  get editorType(): string {
    return this.M.editorType;
  }

  get editorWidth(): number {
    return this.M.editorWidth;
  }

  get linkViewShowMode(): 'NORMAL' | 'MODAL' | 'EMBEDDED' {
    return this.M.linkViewShowMode;
  }

  protected pssyscss: IPSSysCss;
  getPSSysCss(): IPSSysCss | null {
    return (
      this.pssyscss ||
      (this.pssyscss = this.fillObjectModel(
        S._278,
        this.M.getPSSysCss,
        S._2ac,
      ) as IPSSysCss)
    );
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  get refViewShowMode(): 'NORMAL' | 'MODAL' | 'EMBEDDED' {
    return this.M.refViewShowMode;
  }

  get styleCode(): string {
    return this.M.styleCode;
  }

  get extendStyleOnly(): boolean {
    return this.M.extendStyleOnly != null ? this.M.extendStyleOnly : false;
  }

  get replaceDefault(): boolean {
    return this.M.replaceDefault;
  }
  get cls(): string {
    return 'PSSysEditorStyleImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._27a) return true;
    return super.instanceof(cls);
  }
}
